from devtools import debug
from pydantic import (
    BaseModel,
    Field,
    ValidationError,
)


class People(BaseModel):
    name: str = Field(..., description="姓名", min_length=1, max_length=10)


if __name__ == "__main__":
    try:
        People(name="")

    except ValidationError as e:
        debug(e.errors())
